package com.mobi.Survey.lib.activities;

import com.mobi.Survey.lib.model.AlarmPojo;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class AlarmReciver extends BroadcastReceiver {

	@Override
	public void onReceive(Context context, Intent intent) {

		AlarmPojo attr = (AlarmPojo) intent.getExtras().getParcelable("attributes");
		intent.getExtras().clear();
		
		Log.d("Survey   Alarm ID:", attr.getId() + "");
		Log.d("Survey   PendingIntent ID", attr.getPendingIntentId() + "");
		Log.d("Survey   IsRepeat", attr.isRepeat() + "");
		Log.d("Survey   Trigger Time", attr.getTriggerTime() + "");
		Log.d("Survey   End Time", attr.getEnd() + "");
		Log.d("Survey   Alarm Text", attr.getMessage() + "");
		Log.d("Survey   Repeat Type", attr.getRepeatType() + "");
		 
		
		Intent service = new Intent(context, AlarmService.class);

		service.putExtra("attributes", attr);

		context.startService(service);
		

	}
}